#include <map>
using namespace std;

#pragma once

// forward declation
struct SDL_Surface;

// struct created for static table init
typedef struct SurfaceCacheInitEntry
{
	int SurfaceNumber;
	const char* GraphicName;
} SurfaceCacheInitEntry_t;

// class scope surface manager
typedef map<int,SDL_Surface*> IntSurfaceMap; 

class CSDLSurfaceCache
{
public:
	// delayed init
	CSDLSurfaceCache();
	
	// accept static array of object - delmited by closing 0,0 to end array
	virtual void Init(SurfaceCacheInitEntry_t InitTable[]);
	
	// free all surfaces
	virtual ~CSDLSurfaceCache();
	
	// load, optimize and catalog a graphic image by #
	virtual int LoadBmpSurface(int SurfaceNumber,const char* pGraphicImagePath);
	virtual SDL_Surface* GetSurface(int SurfaceNumber); 
		
private:
	IntSurfaceMap m_SurfaceMap;
};
